﻿
Imports System.IO
Imports xmlctrl
Imports xhtmlctrl

Public Class numberinput
    Inherits input

    Public Const functionname As String = "rnn"
    Public Const scriptsrc As String = "function " + functionname + "(t){var p=/[^0-9]/g;" _
                                        + "if(p.test(t.value)){t.value = t.value.replace(p,"""");}}"
    Private script As script = Nothing

    Public Sub New(Optional ByVal buff As Stream = Nothing)
        MyBase.New(buff)
        script = New script(buff)
        script.type = network.http.contentType.textjavascript
        script.text = scriptsrc
        addchild(script)
        MyBase.type = type_enum.text
        onpropertychange = functionname + "(this)"
    End Sub

    Public Shadows Property type() As type_enum
        Get
            Return MyBase.type()
        End Get
        Set(ByVal value As type_enum)
            assert(False, "cannot set type for numberinput.")
        End Set
    End Property

End Class
